﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Namotion.Reflection;

namespace tms.Utility
{
    public static class SummaryHelper
    {
        public static string GetSummary(this object obj)
        {
            var type = obj.GetType();

            foreach (var item in type.GetFields())
            {
                //找到对应的字段
                if (item.GetValue(obj).Equals(obj))
                {
                    return item.GetXmlDocsSummary();
                };
            }

            return null;
        }
    }
}
